package com.aviation.sell_ticket.mapper;

import com.aviation.sell_ticket.pojo.Aviation_passenger;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PassengerMapper {

    @Select("select passenger_id,passenger_name,passenger_number,passenger_phone from aviation_passenger where user_id=#{userId}")
    public List<Aviation_passenger> passengerList(@Param("userId")String userId);

    @Insert("insert into aviation_passenger values(#{passenger.passenger_id},#{passenger.passenger_name},#{passenger.passenger_number},#{passenger.passenger_phone},#{passenger.user_id})")
    public Integer addPassenger(@Param("passenger")Aviation_passenger passenger);

    @Delete("delete from aviation_passenger where passenger_id=#{passenger_id} and user_id=#{userId}")
    public Integer delPassenger(@Param("passenger_id")String passenger_id,@Param("userId")String userId);

}
